const action = (type, payload) => {
  return {
    type,
    payload
  };
};

export const SEARCH_GIVE_YOU_CHANGE = parm => dispatch => {
  fetch(`http://106.12.79.128:666/search/suggest?keywords=${parm}&type=mobile`)
    .then(res => res.json())
    .then(res => {
      return dispatch(action("SEARCH_GIVE_YOU_CHANGE", res.result));
    });
};
